package cat.joronya.supermanager.market;

import cat.joronya.supermanager.R;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;

public class FavProgressDialogFragment extends DialogFragment 
{
	public static FavProgressDialogFragment newInstance(String list) 
	{
		FavProgressDialogFragment frag = new FavProgressDialogFragment();
        Bundle args = new Bundle();
        args.putString("cat.joronya.supermanager.martket.fav.list", list);
        frag.setArguments(args);
        return frag;
    }
	
	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) 
	{
		String list = getArguments().getString("cat.joronya.supermanager.martket.fav.list");

		ProgressDialog pd = new ProgressDialog(getActivity());
		pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
		if( list == null)
			pd.setMessage(getResources().getString(R.string.market_fav_progress_message_adding));
		else
			pd.setMessage(getResources().getString(R.string.market_fav_progress_message_removing));
		
		return pd;
	}
}
